Left Termination of the query pattern s2_in_2(g, a) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

s2(plus(A, plus(B, C)), D) :- s2(plus(plus(A, B), C), D).
s2(plus(A, B), C) :- s2(plus(B, A), C).
s2(plus(X, 0), X).
s2(plus(X, Y), Z) :- ','(s2(X, A), ','(s2(Y, B), s2(plus(A, B), Z))).
s2(plus(A, B), C) :- ','(isNat(A), ','(isNat(B), add(A, B, C))).
isNat(s(X)) :- isNat(X).
isNat(0).
add(s(X), Y, s(Z)) :- add(X, Y, Z).
add(0, X, X).

Queries:

s2(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, B), C) → U61(A, B, C, isNat_in(A))
S2_IN(plus(A, B), C) → ISNAT_IN(A)
ISNAT_IN(s(X)) → U91(X, isNat_in(X))
ISNAT_IN(s(X)) → ISNAT_IN(X)
U61(A, B, C, isNat_out(A)) → U71(A, B, C, isNat_in(B))
U61(A, B, C, isNat_out(A)) → ISNAT_IN(B)
U71(A, B, C, isNat_out(B)) → U81(A, B, C, add_in(A, B, C))
U71(A, B, C, isNat_out(B)) → ADD_IN(A, B, C)
ADD_IN(s(X), Y, s(Z)) → U101(X, Y, Z, add_in(X, Y, Z))
ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
S2_IN(plus(X, Y), Z) → S2_IN(X, A)
S2_IN(plus(A, B), C) → U21(A, B, C, s2_in(plus(B, A), C))
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
S2_IN(plus(A, plus(B, C)), D) → U11(A, B, C, D, s2_in(plus(plus(A, B), C), D))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
U41(X, Y, Z, A, s2_out(Y, B)) → U51(X, Y, Z, s2_in(plus(A, B), Z))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)
U101(x1, x2, x3, x4)  =  U101(x4)
U21(x1, x2, x3, x4)  =  U21(x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
U71(x1, x2, x3, x4)  =  U71(x1, x2, x4)
U51(x1, x2, x3, x4)  =  U51(x4)
U91(x1, x2)  =  U91(x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x4, x5)
U81(x1, x2, x3, x4)  =  U81(x4)
S2_IN(x1, x2)  =  S2_IN(x1)
U61(x1, x2, x3, x4)  =  U61(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, B), C) → U61(A, B, C, isNat_in(A))
S2_IN(plus(A, B), C) → ISNAT_IN(A)
ISNAT_IN(s(X)) → U91(X, isNat_in(X))
ISNAT_IN(s(X)) → ISNAT_IN(X)
U61(A, B, C, isNat_out(A)) → U71(A, B, C, isNat_in(B))
U61(A, B, C, isNat_out(A)) → ISNAT_IN(B)
U71(A, B, C, isNat_out(B)) → U81(A, B, C, add_in(A, B, C))
U71(A, B, C, isNat_out(B)) → ADD_IN(A, B, C)
ADD_IN(s(X), Y, s(Z)) → U101(X, Y, Z, add_in(X, Y, Z))
ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
S2_IN(plus(X, Y), Z) → S2_IN(X, A)
S2_IN(plus(A, B), C) → U21(A, B, C, s2_in(plus(B, A), C))
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
S2_IN(plus(A, plus(B, C)), D) → U11(A, B, C, D, s2_in(plus(plus(A, B), C), D))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
U41(X, Y, Z, A, s2_out(Y, B)) → U51(X, Y, Z, s2_in(plus(A, B), Z))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)
U101(x1, x2, x3, x4)  =  U101(x4)
U21(x1, x2, x3, x4)  =  U21(x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
U71(x1, x2, x3, x4)  =  U71(x1, x2, x4)
U51(x1, x2, x3, x4)  =  U51(x4)
U91(x1, x2)  =  U91(x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x4, x5)
U81(x1, x2, x3, x4)  =  U81(x4)
S2_IN(x1, x2)  =  S2_IN(x1)
U61(x1, x2, x3, x4)  =  U61(x1, x2, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y) → ADD_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
S2_IN(plus(X, Y), Z) → S2_IN(X, A)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x3)
U10(x1, x2, x3, x4)  =  U10(x4)
s2_out(x1, x2)  =  s2_out(x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
U2(x1, x2, x3, x4)  =  U2(x4)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
U4(x1, x2, x3, x4, x5)  =  U4(x4, x5)
U5(x1, x2, x3, x4)  =  U5(x4)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x4, x5)
S2_IN(x1, x2)  =  S2_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U31(Y, s2_out(A)) → S2_IN(Y)
U41(A, s2_out(B)) → S2_IN(plus(A, B))
U31(Y, s2_out(A)) → U41(A, s2_in(Y))
S2_IN(plus(X, Y)) → U31(Y, s2_in(X))
S2_IN(plus(X, Y)) → S2_IN(X)
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out
isNat_in(s(X)) → U9(isNat_in(X))
U9(isNat_out) → isNat_out
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out) → U8(add_in(A, B))
add_in(0, X) → add_out(X)
add_in(s(X), Y) → U10(add_in(X, Y))
U10(add_out(Z)) → add_out(s(Z))
U8(add_out(C)) → s2_out(C)
s2_in(plus(X, Y)) → U3(Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
U5(s2_out(Z)) → s2_out(Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U31(Y, s2_out(A)) → S2_IN(Y)
S2_IN(plus(X, Y)) → S2_IN(X)
The remaining pairs can at least be oriented weakly.

U41(A, s2_out(B)) → S2_IN(plus(A, B))
U31(Y, s2_out(A)) → U41(A, s2_in(Y))
S2_IN(plus(X, Y)) → U31(Y, s2_in(X))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(S2_IN(x1)) = x1   
POL(U1(x1)) = x1   
POL(U10(x1)) = x1   
POL(U2(x1)) = x1   
POL(U3(x1, x2)) = 1 + x1 + x2   
POL(U31(x1, x2)) = 1 + x1 + x2   
POL(U4(x1, x2)) = 1 + x1 + x2   
POL(U41(x1, x2)) = 1 + x1 + x2   
POL(U5(x1)) = x1   
POL(U6(x1, x2, x3)) = x1 + x2   
POL(U7(x1, x2, x3)) = x2   
POL(U8(x1)) = x1   
POL(U9(x1)) = 1   
POL(add_in(x1, x2)) = x2   
POL(add_out(x1)) = x1   
POL(isNat_in(x1)) = 1 + x1   
POL(isNat_out) = 0   
POL(plus(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = x1   
POL(s2_in(x1)) = x1   
POL(s2_out(x1)) = x1   

The following usable rules [17] were oriented:

s2_in(plus(X, Y)) → U3(Y, s2_in(X))
U7(A, B, isNat_out) → U8(add_in(A, B))
s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U8(add_out(C)) → s2_out(C)
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U10(add_out(Z)) → add_out(s(Z))
U5(s2_out(Z)) → s2_out(Z)
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
add_in(s(X), Y) → U10(add_in(X, Y))
s2_in(plus(X, 0)) → s2_out(X)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
add_in(0, X) → add_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U41(A, s2_out(B)) → S2_IN(plus(A, B))
S2_IN(plus(X, Y)) → U31(Y, s2_in(X))
U31(Y, s2_out(A)) → U41(A, s2_in(Y))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out
isNat_in(s(X)) → U9(isNat_in(X))
U9(isNat_out) → isNat_out
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out) → U8(add_in(A, B))
add_in(0, X) → add_out(X)
add_in(s(X), Y) → U10(add_in(X, Y))
U10(add_out(Z)) → add_out(s(Z))
U8(add_out(C)) → s2_out(C)
s2_in(plus(X, Y)) → U3(Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
U5(s2_out(Z)) → s2_out(Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U41(A, s2_out(B)) → S2_IN(plus(A, B))
U31(Y, s2_out(A)) → U41(A, s2_in(Y))
The remaining pairs can at least be oriented weakly.

S2_IN(plus(X, Y)) → U31(Y, s2_in(X))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))
Used ordering: Polynomial interpretation [25]:

POL(0) = 1   
POL(S2_IN(x1)) = 1 + x1   
POL(U1(x1)) = x1   
POL(U10(x1)) = 1 + x1   
POL(U2(x1)) = x1   
POL(U3(x1, x2)) = x1 + x2   
POL(U31(x1, x2)) = 1 + x1 + x2   
POL(U4(x1, x2)) = 1 + x1 + x2   
POL(U41(x1, x2)) = 1 + x1 + x2   
POL(U5(x1)) = 1 + x1   
POL(U6(x1, x2, x3)) = x1 + x2   
POL(U7(x1, x2, x3)) = x1 + x2   
POL(U8(x1)) = x1   
POL(U9(x1)) = 1   
POL(add_in(x1, x2)) = x1 + x2   
POL(add_out(x1)) = 1 + x1   
POL(isNat_in(x1)) = x1   
POL(isNat_out) = 0   
POL(plus(x1, x2)) = x1 + x2   
POL(s(x1)) = 1 + x1   
POL(s2_in(x1)) = x1   
POL(s2_out(x1)) = 1 + x1   

The following usable rules [17] were oriented:

s2_in(plus(X, Y)) → U3(Y, s2_in(X))
U7(A, B, isNat_out) → U8(add_in(A, B))
s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U8(add_out(C)) → s2_out(C)
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U10(add_out(Z)) → add_out(s(Z))
U5(s2_out(Z)) → s2_out(Z)
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
add_in(s(X), Y) → U10(add_in(X, Y))
s2_in(plus(X, 0)) → s2_out(X)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
add_in(0, X) → add_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(X, Y)) → U31(Y, s2_in(X))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out
isNat_in(s(X)) → U9(isNat_in(X))
U9(isNat_out) → isNat_out
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out) → U8(add_in(A, B))
add_in(0, X) → add_out(X)
add_in(s(X), Y) → U10(add_in(X, Y))
U10(add_out(Z)) → add_out(s(Z))
U8(add_out(C)) → s2_out(C)
s2_in(plus(X, Y)) → U3(Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
U5(s2_out(Z)) → s2_out(Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
QDP
                                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out
isNat_in(s(X)) → U9(isNat_in(X))
U9(isNat_out) → isNat_out
U6(A, B, isNat_out) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out) → U8(add_in(A, B))
add_in(0, X) → add_out(X)
add_in(s(X), Y) → U10(add_in(X, Y))
U10(add_out(Z)) → add_out(s(Z))
U8(add_out(C)) → s2_out(C)
s2_in(plus(X, Y)) → U3(Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(X)
s2_in(plus(A, B)) → U2(s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(s2_in(plus(plus(A, B), C)))
U1(s2_out(D)) → s2_out(D)
U2(s2_out(C)) → s2_out(C)
U3(Y, s2_out(A)) → U4(A, s2_in(Y))
U4(A, s2_out(B)) → U5(s2_in(plus(A, B)))
U5(s2_out(Z)) → s2_out(Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

R is empty.
The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

s2_in(x0)
isNat_in(x0)
U9(x0)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0)
U8(x0)
U1(x0)
U2(x0)
U3(x0, x1)
U4(x0, x1)
U5(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:none


s = S2_IN(plus(A, B)) evaluates to t =S2_IN(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN(plus(A, B)) to S2_IN(plus(B, A)).




We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, B), C) → U61(A, B, C, isNat_in(A))
S2_IN(plus(A, B), C) → ISNAT_IN(A)
ISNAT_IN(s(X)) → U91(X, isNat_in(X))
ISNAT_IN(s(X)) → ISNAT_IN(X)
U61(A, B, C, isNat_out(A)) → U71(A, B, C, isNat_in(B))
U61(A, B, C, isNat_out(A)) → ISNAT_IN(B)
U71(A, B, C, isNat_out(B)) → U81(A, B, C, add_in(A, B, C))
U71(A, B, C, isNat_out(B)) → ADD_IN(A, B, C)
ADD_IN(s(X), Y, s(Z)) → U101(X, Y, Z, add_in(X, Y, Z))
ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
S2_IN(plus(X, Y), Z) → S2_IN(X, A)
S2_IN(plus(A, B), C) → U21(A, B, C, s2_in(plus(B, A), C))
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
S2_IN(plus(A, plus(B, C)), D) → U11(A, B, C, D, s2_in(plus(plus(A, B), C), D))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
U41(X, Y, Z, A, s2_out(Y, B)) → U51(X, Y, Z, s2_in(plus(A, B), Z))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)
U101(x1, x2, x3, x4)  =  U101(x1, x2, x4)
U21(x1, x2, x3, x4)  =  U21(x1, x2, x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x1, x2, x3, x5)
U71(x1, x2, x3, x4)  =  U71(x1, x2, x4)
U51(x1, x2, x3, x4)  =  U51(x1, x2, x4)
U91(x1, x2)  =  U91(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x1, x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x4, x5)
U81(x1, x2, x3, x4)  =  U81(x1, x2, x4)
S2_IN(x1, x2)  =  S2_IN(x1)
U61(x1, x2, x3, x4)  =  U61(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, B), C) → U61(A, B, C, isNat_in(A))
S2_IN(plus(A, B), C) → ISNAT_IN(A)
ISNAT_IN(s(X)) → U91(X, isNat_in(X))
ISNAT_IN(s(X)) → ISNAT_IN(X)
U61(A, B, C, isNat_out(A)) → U71(A, B, C, isNat_in(B))
U61(A, B, C, isNat_out(A)) → ISNAT_IN(B)
U71(A, B, C, isNat_out(B)) → U81(A, B, C, add_in(A, B, C))
U71(A, B, C, isNat_out(B)) → ADD_IN(A, B, C)
ADD_IN(s(X), Y, s(Z)) → U101(X, Y, Z, add_in(X, Y, Z))
ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
S2_IN(plus(X, Y), Z) → S2_IN(X, A)
S2_IN(plus(A, B), C) → U21(A, B, C, s2_in(plus(B, A), C))
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
S2_IN(plus(A, plus(B, C)), D) → U11(A, B, C, D, s2_in(plus(plus(A, B), C), D))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
U41(X, Y, Z, A, s2_out(Y, B)) → U51(X, Y, Z, s2_in(plus(A, B), Z))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)
U101(x1, x2, x3, x4)  =  U101(x1, x2, x4)
U21(x1, x2, x3, x4)  =  U21(x1, x2, x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x1, x2, x3, x5)
U71(x1, x2, x3, x4)  =  U71(x1, x2, x4)
U51(x1, x2, x3, x4)  =  U51(x1, x2, x4)
U91(x1, x2)  =  U91(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x1, x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x4, x5)
U81(x1, x2, x3, x4)  =  U81(x1, x2, x4)
S2_IN(x1, x2)  =  S2_IN(x1)
U61(x1, x2, x3, x4)  =  U61(x1, x2, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y, s(Z)) → ADD_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD_IN(x1, x2, x3)  =  ADD_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

ADD_IN(s(X), Y) → ADD_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)
ISNAT_IN(x1)  =  ISNAT_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

ISNAT_IN(s(X)) → ISNAT_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U31(X, Y, Z, s2_out(X, A)) → S2_IN(Y, B)
S2_IN(plus(X, Y), Z) → U31(X, Y, Z, s2_in(X, A))
U41(X, Y, Z, A, s2_out(Y, B)) → S2_IN(plus(A, B), Z)
S2_IN(plus(A, B), C) → S2_IN(plus(B, A), C)
U31(X, Y, Z, s2_out(X, A)) → U41(X, Y, Z, A, s2_in(Y, B))
S2_IN(plus(A, plus(B, C)), D) → S2_IN(plus(plus(A, B), C), D)
S2_IN(plus(X, Y), Z) → S2_IN(X, A)

The TRS R consists of the following rules:

s2_in(plus(A, B), C) → U6(A, B, C, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, C, isNat_out(A)) → U7(A, B, C, isNat_in(B))
U7(A, B, C, isNat_out(B)) → U8(A, B, C, add_in(A, B, C))
add_in(0, X, X) → add_out(0, X, X)
add_in(s(X), Y, s(Z)) → U10(X, Y, Z, add_in(X, Y, Z))
U10(X, Y, Z, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, C, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y), Z) → U3(X, Y, Z, s2_in(X, A))
s2_in(plus(X, 0), X) → s2_out(plus(X, 0), X)
s2_in(plus(A, B), C) → U2(A, B, C, s2_in(plus(B, A), C))
s2_in(plus(A, plus(B, C)), D) → U1(A, B, C, D, s2_in(plus(plus(A, B), C), D))
U1(A, B, C, D, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, C, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, Z, s2_out(X, A)) → U4(X, Y, Z, A, s2_in(Y, B))
U4(X, Y, Z, A, s2_out(Y, B)) → U5(X, Y, Z, s2_in(plus(A, B), Z))
U5(X, Y, Z, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The argument filtering Pi contains the following mapping:
s2_in(x1, x2)  =  s2_in(x1)
plus(x1, x2)  =  plus(x1, x2)
U6(x1, x2, x3, x4)  =  U6(x1, x2, x4)
isNat_in(x1)  =  isNat_in(x1)
0  =  0
isNat_out(x1)  =  isNat_out(x1)
s(x1)  =  s(x1)
U9(x1, x2)  =  U9(x1, x2)
U7(x1, x2, x3, x4)  =  U7(x1, x2, x4)
U8(x1, x2, x3, x4)  =  U8(x1, x2, x4)
add_in(x1, x2, x3)  =  add_in(x1, x2)
add_out(x1, x2, x3)  =  add_out(x1, x2, x3)
U10(x1, x2, x3, x4)  =  U10(x1, x2, x4)
s2_out(x1, x2)  =  s2_out(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x1, x2, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x2, x4)
U1(x1, x2, x3, x4, x5)  =  U1(x1, x2, x3, x5)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x4, x5)
U5(x1, x2, x3, x4)  =  U5(x1, x2, x4)
U31(x1, x2, x3, x4)  =  U31(x1, x2, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x4, x5)
S2_IN(x1, x2)  =  S2_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U41(X, Y, A, s2_out(Y, B)) → S2_IN(plus(A, B))
S2_IN(plus(X, Y)) → U31(X, Y, s2_in(X))
U31(X, Y, s2_out(X, A)) → U41(X, Y, A, s2_in(Y))
U31(X, Y, s2_out(X, A)) → S2_IN(Y)
S2_IN(plus(X, Y)) → S2_IN(X)
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U31(X, Y, s2_out(X, A)) → S2_IN(Y)
S2_IN(plus(X, Y)) → S2_IN(X)
The remaining pairs can at least be oriented weakly.

U41(X, Y, A, s2_out(Y, B)) → S2_IN(plus(A, B))
S2_IN(plus(X, Y)) → U31(X, Y, s2_in(X))
U31(X, Y, s2_out(X, A)) → U41(X, Y, A, s2_in(Y))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(S2_IN(x1)) = x1   
POL(U1(x1, x2, x3, x4)) = x4   
POL(U10(x1, x2, x3)) = 0   
POL(U2(x1, x2, x3)) = x3   
POL(U3(x1, x2, x3)) = 1 + x2 + x3   
POL(U31(x1, x2, x3)) = 1 + x2 + x3   
POL(U4(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U41(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U5(x1, x2, x3)) = x3   
POL(U6(x1, x2, x3)) = x2   
POL(U7(x1, x2, x3)) = x2   
POL(U8(x1, x2, x3)) = x3   
POL(U9(x1, x2)) = 0   
POL(add_in(x1, x2)) = x2   
POL(add_out(x1, x2, x3)) = x3   
POL(isNat_in(x1)) = 0   
POL(isNat_out(x1)) = 0   
POL(plus(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 0   
POL(s2_in(x1)) = x1   
POL(s2_out(x1, x2)) = x2   

The following usable rules [17] were oriented:

U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)
s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U41(X, Y, A, s2_out(Y, B)) → S2_IN(plus(A, B))
S2_IN(plus(X, Y)) → U31(X, Y, s2_in(X))
U31(X, Y, s2_out(X, A)) → U41(X, Y, A, s2_in(Y))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U41(X, Y, A, s2_out(Y, B)) → S2_IN(plus(A, B))
S2_IN(plus(X, Y)) → U31(X, Y, s2_in(X))
The remaining pairs can at least be oriented weakly.

U31(X, Y, s2_out(X, A)) → U41(X, Y, A, s2_in(Y))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))
Used ordering: Polynomial interpretation [25]:

POL(0) = 1   
POL(S2_IN(x1)) = x1   
POL(U1(x1, x2, x3, x4)) = x4   
POL(U10(x1, x2, x3)) = 0   
POL(U2(x1, x2, x3)) = x3   
POL(U3(x1, x2, x3)) = 1 + x2 + x3   
POL(U31(x1, x2, x3)) = x2 + x3   
POL(U4(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U41(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U5(x1, x2, x3)) = x3   
POL(U6(x1, x2, x3)) = 1 + x1 + x2   
POL(U7(x1, x2, x3)) = 1 + x1 + x2   
POL(U8(x1, x2, x3)) = 1 + x1 + x3   
POL(U9(x1, x2)) = 0   
POL(add_in(x1, x2)) = x2   
POL(add_out(x1, x2, x3)) = x3   
POL(isNat_in(x1)) = 0   
POL(isNat_out(x1)) = 0   
POL(plus(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 0   
POL(s2_in(x1)) = x1   
POL(s2_out(x1, x2)) = 1 + x2   

The following usable rules [17] were oriented:

U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)
s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U31(X, Y, s2_out(X, A)) → U41(X, Y, A, s2_in(Y))
S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
QDP
                                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:

s2_in(plus(A, B)) → U6(A, B, isNat_in(A))
isNat_in(0) → isNat_out(0)
isNat_in(s(X)) → U9(X, isNat_in(X))
U9(X, isNat_out(X)) → isNat_out(s(X))
U6(A, B, isNat_out(A)) → U7(A, B, isNat_in(B))
U7(A, B, isNat_out(B)) → U8(A, B, add_in(A, B))
add_in(0, X) → add_out(0, X, X)
add_in(s(X), Y) → U10(X, Y, add_in(X, Y))
U10(X, Y, add_out(X, Y, Z)) → add_out(s(X), Y, s(Z))
U8(A, B, add_out(A, B, C)) → s2_out(plus(A, B), C)
s2_in(plus(X, Y)) → U3(X, Y, s2_in(X))
s2_in(plus(X, 0)) → s2_out(plus(X, 0), X)
s2_in(plus(A, B)) → U2(A, B, s2_in(plus(B, A)))
s2_in(plus(A, plus(B, C))) → U1(A, B, C, s2_in(plus(plus(A, B), C)))
U1(A, B, C, s2_out(plus(plus(A, B), C), D)) → s2_out(plus(A, plus(B, C)), D)
U2(A, B, s2_out(plus(B, A), C)) → s2_out(plus(A, B), C)
U3(X, Y, s2_out(X, A)) → U4(X, Y, A, s2_in(Y))
U4(X, Y, A, s2_out(Y, B)) → U5(X, Y, s2_in(plus(A, B)))
U5(X, Y, s2_out(plus(A, B), Z)) → s2_out(plus(X, Y), Z)

The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

R is empty.
The set Q consists of the following terms:

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

s2_in(x0)
isNat_in(x0)
U9(x0, x1)
U6(x0, x1, x2)
U7(x0, x1, x2)
add_in(x0, x1)
U10(x0, x1, x2)
U8(x0, x1, x2)
U1(x0, x1, x2, x3)
U2(x0, x1, x2)
U3(x0, x1, x2)
U4(x0, x1, x2, x3)
U5(x0, x1, x2)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

S2_IN(plus(A, plus(B, C))) → S2_IN(plus(plus(A, B), C))
S2_IN(plus(A, B)) → S2_IN(plus(B, A))

The TRS R consists of the following rules:none


s = S2_IN(plus(A, B)) evaluates to t =S2_IN(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN(plus(A, B)) to S2_IN(plus(B, A)).